<!-- pages/index.vue -->
<template>
	<view class="container">
		<bluetoothComponent />
	</view>
</template>

<script>
	import bluetoothComponent from '@/components/bluetoothComponent'
	export default {
		components: {
			bluetoothComponent
		},
		data() {
			return {
				testWeight: 0
			}
		},
		methods: {
			handleZeroReset() {
				this.$store.dispatch('weight/zeroReset');
			},
			handleTare() {
				this.$store.dispatch('weight/tare');
			},
			handleConnect() {
				this.$store.dispatch('weight/connectDevice');
			},
			handleDisconnect() {
				this.$store.dispatch('weight/disconnectDevice');
			},
			updateTestWeight() {

				this.$store.dispatch('weight/updateWeight', Number(this.testWeight));
			}
		}
	}
</script>

<style>
	.container {
		padding: 20rpx;
	}

	.action-buttons {
		margin-top: 40rpx;
	}

	.action-buttons button {
		margin: 10rpx;
	}

	.test-controls {
		margin-top: 40rpx;
	}

	.test-controls input {
		border: 1px solid #ddd;
		padding: 10rpx;
		margin-right: 20rpx;
	}
</style>